package com.edfapp;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

import java.net.InetAddress;
import java.net.UnknownHostException;

@Slf4j
@SpringBootApplication
public class EdfParserApplication {

    public static void main(String[] args) throws UnknownHostException {
//        SpringApplication.run(EdfParserApplication.class, args);
        SpringApplication app = new SpringApplication(EdfParserApplication.class);
        ConfigurableApplicationContext application = app.run(args);;
        Environment env = application.getEnvironment();
        String ip = InetAddress.getLocalHost().getHostAddress();
        String port = env.getProperty("server.port");
        log.info("\n----------------------------------------------------------\n\t" +
                "(♥◠‿◠)ﾉﾞ    EDF服务启动成功   ლ(´ڡ`ლ)ﾞ! Access URLs:\n\t" +
                "Local: \t\thttp://localhost:" + port + "\n\t" +
                "接口文档: \thttp://" + ip + ":" + port + "/doc.html\n" +
                "----------------------------------------------------------");

    }
} 